package com.health.ts.service.patientview;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.ts.dao.patientview.StTestResultMapper;
import com.health.ts.entity.patientview.StTestResult;

/**
 * <p>
 * 检验结果 服务实现类
 * </p>
 *
 * @author ts
 * @since 2017-09-15
 */
@Service
public class StTestResultService extends ServiceImpl<StTestResultMapper, StTestResult> {
	
	@Autowired
	StTestResultMapper testResultMapper;
	
	/**
	 * 获取检验名列表
	 * @param patient_id
	 * @return
	 */
	public List<StTestResult> getTestOrderNameList(String patientId){
		List<StTestResult> orderNameList=testResultMapper.getTestOrderNameList(patientId);
		return orderNameList;
	}
	
	/**
	 * 获取检验项目列表
	 * @param patient_id
	 * @return
	 */
	public List<StTestResult> getTestOrderItemList(String patientId,String orderId){
		QueryWrapper<StTestResult> wrapper = new QueryWrapper<StTestResult>();
		wrapper.eq("patient_id", patientId);
		wrapper.eq("order_id", orderId);
		wrapper.orderByAsc("test_date");
		return this.list(wrapper);
	}
	
}
